<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="keywords" content="首页关键字" />
  <meta name="description" content="首页描述" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Cache-Control" content="no-cache" />
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=2.0" />
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  
  <link rel="stylesheet" href="../../resources/css/weui/weui.min.css">
  <link rel="stylesheet" href="../../resources/css/main.min.css">
  <link rel="stylesheet" href="../../resources/css/man.min.css">
  
  <script src="../../resources/js/jquery-1.10.min.js"></script>
  <script src="../../resources/js/jquery.touchSwipe.min.js"></script>
  <script src="../../resources/js/frmwebm.min.js"></script>
  <title>机构编辑</title>
  <style>
  .weui_label{
    font-size:15px;
  }
  </style>
</head>
<body style="background: #ebebeb none repeat scroll 0 0;">
	<form id="form">
	<div class="weui_cells" style="margin-top: 0px;">
		<div class="weui_cell" style="background:#646365;">
			<div class="weui_cell_bd weui_cell_primary">
				<img style="height:18px" src="../../resources/images/u7.png">
			</div>
			<div onclick="save()" class="weui_cell_ft" style="color:#ffffff;">保存</div>
		</div>
		
		<div class="weui_cell" style="padding-top: 25px;">
			<div class="weui_cell_hd">
				<label class="weui_label">机构名称</label>
			</div>
			<div class="weui_cell_bd weui_cell_primary">
				<input id="name" type="text" class="weui_input">
			</div>
		</div>
		<div class="weui_progress" style="margin-left: 15px; margin-right: 15px;margin-top: -10px;">
			<div class="weui_progress_bar" style="background-color: #ffffff;">
				<div style="width: 100%; height: 1px;" class="weui_progress_inner_bar js_progress"></div>
			</div>
		</div>
		
		<article class="weui_article" style="color: #999999;font-size:14px;background: #ffffff none repeat scroll 0 0;">
			<div style="margin:5px;">1、机构最为人所知的品牌名，如金宝贝</div>
			<div style="margin:5px;">2、如机构为分店，品牌分店，如金宝贝武展店</div>
			<div style="margin:5px;">3、如机构为总店，品牌武汉店，如金宝贝武汉店</div>
		</article>
	</div>
	
	</form>
	
	<div class="weui_msg">
	</div>
	
	<div class="weui_msg">
	</div>

<script type="text/javascript">
document.getElementById("name").focus();

function save()
{
	var temp = document.getElementById("name");
	var str = temp.value;
	var realLength = 0, len = str.length, charCode = -1;
	for (var i = 0; i < len; i++)
	{
		charCode = str.charCodeAt(i);
		if (charCode >= 256)
			realLength = realLength+2;
		else
			realLength++;
	}
	
	if(realLength>24 || realLength==0)
	{
		alert('输入不合法！');
		temp.focus();
		return false;
	}
	
	var myreg=/^[a-zA-Z\u2E80-\u9FFF]+$/;
	if(!myreg.test(temp.value))
	{
		alert('输入不合法！');
		temp.focus();
		return false;
	}
	
	frmwebm.toast('保存成功', 2000);
	setTimeout(function ()
	{
		window.location.href = "view.jsp";
	}, 2000);
}
</script>
</body>
</html>
